<template>
    <div>
        <p>
            当前已选中<span>{{sum.length}}</span>项，共<span>{{num}}</span>项
            <button @click="del">清空</button>
        </p>
    </div>
</template>

<script setup >
import { computed ,defineProps, defineEmits } from 'vue'
// 定义 props
 let name = defineProps({
    tasks: {
        type: Array

    }
});
let emits = defineEmits(['sendData']);
let num = computed(() => {
    return name.tasks.length
});
let sum = computed(() => {
    return name.tasks.filter(item => item.isDone==true)
});
let del = function(value){
    emits('sendData',value)
};
</script>

<style>

</style>